SwitchCompat
Construct a new Switch with default styling.
Parameters
context
The Context that will determine this widget's theming.
Construct a new Switch with default styling, overriding specific style attributes as requested.
Parameters
context
The Context that will determine this widget's theming.
attrs
Specification of attributes that should deviate from default styling.
constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet, defStyleAttr: Int)(source)
Construct a new Switch with a default style determined by the given theme attribute, overriding specific style attributes as requested.
Parameters
context
The Context that will determine this widget's theming.
attrs
Specification of attributes that should deviate from the default styling.
defStyleAttr
An attribute in the current theme that contains a reference to a style resource that supplies default values for the view. Can be 0 to not look for defaults.